import * as types from '../action-types';

const initialState = { number: 5 };
const counter = (oldState = initialState, action) => {
    switch (action.type) {
        case types.ADD:
            return { number: oldState.number + 1 };
        case types.MINUS:
            return { number: oldState.number - 1 };
        default:
            return oldState;
    }
}

export default counter;